import request from "@/utils/request";
import { BASE_URL } from "@/config";
// 登录方法
export function login(username, password) {
  const data = {
    username,
    password,
  };
  return request({
    url: BASE_URL + "/login",
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
    method: "post",
    data: data,
  });
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: BASE_URL + "/getInfo",
    method: "get",
  });
}

// 退出方法
export function logout() {
  return request({
    url: BASE_URL + "/login",
    method: "post",
  });
}

// 获取菜单
export function getRouters() {
  return request({
    url: BASE_URL + "/getRouters",
    method: "get",
  });
}
